<div id="cdtabarea" style="width: 100%;z-index: 100;height: 30px;"> 
    <ul id="cdtoptabs">
        {{if isset($_SESSION["ADP"]["USER"])}}
        <li class="cdtopn {{if !isset($menu)}}cdselected{{/if}}"><a href="{{base_url('APanel')}}" accesskey="1">Home</a></li>
        <li class="cdtopn cdhzmore {{if $menu=="website"}}cdselected{{/if}}"><span>Website</span>
            <img src="{{base_url()}}syslib/sysimages/menu/more_arrow.png" alt="">
            <ul class="cdsectabs">
                <li class="cdsecn"><a href="{{base_url('APanel/settings')}}">Tùy Chỉnh</a></li>
                <li class="cdsecn"><a href="{{base_url('APanel/content')}}">Quản lý nội dung</a></li>
                <li class="cdsecn cdsecnlast"><span>&nbsp;</span></li>
            </ul>
        </li>
        <li class="cdtopn cdhzmore {{if $menu=="product"}}cdselected{{/if}}"><span>Sản Phẩm - Deal</span>
            <img src="{{base_url()}}syslib/sysimages/menu/more_arrow.png" alt="">
            <ul class="cdsectabs">
                <li class="cdsecn"><a href="{{base_url('APanel/category')}}">Quản lý danh Mục</a></li>
                <li class="cdsecn"><a href="{{base_url('APanel/product')}}">Quản lý sản phẩm - deal</a></li>
                <li class="cdsecn"><a href="{{base_url('APanel/order')}}">Quản lý đơn hàng</a></li>
                <li class="cdsecn cdsecnlast"><span>&nbsp;</span></li>
            </ul>
        </li>
        <li class="cdtopn cdhzmore {{if $menu=="customer"}}cdselected{{/if}}"><span>Khách Hàng</span>
            <img src="{{base_url()}}syslib/sysimages/menu/more_arrow.png" alt="">
            <ul class="cdsectabs">
                <li class="cdsecn"><a href="{{base_url('APanel/customer')}}">Quản lý khách hàng</a></li>
                <li class="cdsecn"><a href="{{base_url('APanel/subscriber')}}">Quản lý Email nhận thông báo</a></li>
                <li class="cdsecn"><a href="{{base_url('APanel/sendmail')}}">Gửi Email thông báo</a></li>
                <li class="cdsecn cdsecnlast"><span>&nbsp;</span></li>
            </ul>
        </li>
        <li class="cdtopn cdhzmore {{if $menu=="report"}}cdselected{{/if}}"><span>Thống kê</span>
            <img src="{{base_url()}}syslib/sysimages/menu/more_arrow.png" alt="">
            <ul class="cdsectabs">
                <li class="cdsecn"><a href="{{base_url('APanel/report/product')}}">Thống kê sản phẩm</a></li>
                
                <li class="cdsecn cdsecnlast"><span>&nbsp;</span></li>
            </ul>
        </li>
        <li class="cdtopn cdhzmore {{if $menu=="other"}}cdselected{{/if}}"><span>Khác</span>
            <img src="{{base_url()}}syslib/sysimages/menu/more_arrow.png" alt="">
            <ul class="cdsectabs">
                <li class="cdsecn"><a href="{{base_url('APanel/region')}}">Quản lý khu vực</a></li>
                <li class="cdsecn"><a href="{{base_url('APanel/leftmenu')}}">Quản lý Menu trái</a></li>
                <li class="cdsecn"><a href="{{base_url('APanel/footer')}}">Quản lý Footer</a></li>
                <li class="cdsecn"><a href="{{base_url('APanel/partner')}}">Quản lý đối tác</a></li>
                <li class="cdsecn"><a href="{{base_url('APanel/type')}}">Mục khác</a></li>
                <li class="cdsecn cdsecnlast"><span>&nbsp;</span></li>
            </ul>
        </li>
        <li class="cdtopn {{if $menu=="filemanage"}}cdselected{{/if}}"><a href="{{base_url('APanel/filemanage')}}">File Manage</a></li>
        
        <li class="cdtopn cdhzmore fr"><span>{{$_SESSION["ADP"]["USER"]["Name"]}}</span>
            <img src="{{base_url()}}syslib/sysimages/menu/more_arrow.png" alt="">
            <ul class="cdsectabs">
                <li class="cdsecn"><a href="{{base_url('APanel/authority')}}">My Authority</a></li>
                <li class="cdsecn" onclick="ChangeMyPassWord();"><span>Change My Secret Key</span></li>
                <li class="cdsecn"><a href="{{base_url('OAuth/home/logout')}}">Logout</a></li>
                <li class="cdsecn cdsecnlast"><span>&nbsp;</span></li>
            </ul>
        </li>
        <li class="cdtopn fr {{if $menu=="user"}}cdselected{{/if}}"><a href="{{base_url('APanel/user')}}">User Manager</a></li>
        {{else}}
        <li class="cdtopn fr"><a href="{{base_url('OAuth')}}">Login</a></li>
        {{/if}}
        <li class="cdtopn fr"><a href="{{base_url('APanel/guide')}}">Help</a></li>
    </ul>
</div>
    <div id="frmchangemypassword" class="hidden">
        <table class="pt20 pl20 pb20 pr20">
            <tr>
                <td class="pr12">Current Secret Key</td>
                <td>
                    <input type="password" class="classic-input"
                    name="txtcurrentpassword" id="txtcurrentpassword"/>
                </td>
            </tr>
            <tr>
                <td class="pr12">New Secret Key</td>
                <td>
                    <input type="password" class="classic-input"
                    name="txtnewpassword" id="txtnewpassword"/>
                </td>
            </tr>
        </table>
    </div>

<script>
    function ChangeMyPassWord(){
        ShowConfirmDialogMessage($("#frmchangemypassword"), "Change your Secret Key", function(){
            if(isrunning) return;
            if(!_FcheckFilled($("#txtcurrentpassword").val())){
                $("#txtcurrentpassword").focus();
                return;
            }
            if(!_FcheckFilled($("#txtnewpassword").val())){
                $("#txtnewpassword").focus();
                return;
            }
            var url = "{{base_url()}}OAuth/home/changepassword/940cc81cec5c7e119162e62bd57710f0"
            var data={
                currentpass : $("#txtcurrentpassword").val(),
                newpass : $("#txtnewpassword").val()
            }
            isrunning=true;
            jqxAjax(url,data,function(result){
                isrunning=false;
                try{
                    if(result.code<0){
                        ShowErrorDialogMessage(result.msg);
                    }else{
                        CloseConfirmDialogMessage($("#frmchangemypassword"));
                        ShowErrorDialogMessage(result.msg);
                    }
                }catch(e){                                    
                    $(".error").html(e.message);
                }
            });
        });
    }
</script>